Added github workflow to support NPM publish on merge#3
Added github workflow to support NPM publish on merge#3revanth0212 wants to merge 3 commits intomainfrom
Conversation
.github/workflows/publish-to-npm.yml
Outdated
| - main | ||
| - develop | ||
| - epic/** |
There was a problem hiding this comment.
If we do not want to support auto publish on develop and epic branches, we can always change this
.github/workflows/publish-to-npm.yml
Outdated
| elif [ "$target_branch" == "develop" ]; then | ||
| if [[ "${{ steps.get_version.outputs.version }}" =~ beta ]]; then | ||
| version_tag="beta" | ||
| else | ||
| echo "Will not publish. Version on branch \"$target_branch\" is not beta."; | ||
| exit 0; | ||
| fi | ||
|
|
||
| elif [[ $target_branch == epic/* ]]; then | ||
| if [[ "${{ steps.get_version.outputs.version }}" =~ alpha ]]; then | ||
| version_tag="alpha" | ||
| else | ||
| echo "Will not publish. Version on branch \"$target_branch\" is not alpha."; | ||
| exit 0; | ||
| fi |
There was a problem hiding this comment.
This block automatically publishes alpha and beta versions based on the branch involved. This will be helpful to test the features before releasing the stable version.
If this is not needed, we can always comment out these blocks for the time being.
There was a problem hiding this comment.
I see. Is the epic concept something you guys use on the mesh cli? Could probably comment that out for now, I imagine we will mostly just use main and develop before Summit.
There was a problem hiding this comment.
Sure Ill comment it out
| if: ${{ steps.verify_version.outputs.version_tag != '' }} | ||
| uses: JS-DevTools/npm-publish@v1 | ||
| with: | ||
| token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} |
There was a problem hiding this comment.
Thanks. Will you start that process for us?
There was a problem hiding this comment.
They usually expect the repo owners or code owners to do it. I can help you with the required steps but you will have to initiate the process.
There was a problem hiding this comment.
OK cool. No worries. Let me know how to kick that off and I will.
| node-version: 18 | ||
|
|
||
| - name: Yarn install | ||
| run: yarn install --frozen-lockfile |
There was a problem hiding this comment.
Looks like I didn't include a yarn.lock or package-lock.json. Do you have preference? Seems like mesh probably uses yarn.
There was a problem hiding this comment.
Yeah we use yarn. Its not necessary to do it that way. I left it so we could discuss. Hence I left the PR as a draft. Once we decide what to do, ill apply the changes and convert the PR to ready.
There was a problem hiding this comment.
I have added the yarn.lock file to this PR. Having it will ensure that the package published will be same as the version we tested locally.

Description
Added github workflow to support NPM publish based on based branch of the closed PR
Related Issue
TBD
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: